from application.config import appSettings
from masoniteorm.relationships import has_many, belongs_to
from ..base import BaseModel


class Company(BaseModel):
    __table__ = appSettings.db_prefix + 'companies'

    @has_many('id', 'parent_id')
    def children(self):
        return Company

    @belongs_to('brand_id', 'brand_id')
    def brand_user(self):
        from .BrandUser import BrandUser
        return BrandUser


__all__ = ['Company']
